<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>${metadata.alias!}</title>
    <style type="text/css">
        .right{float:right;}
    </style>
</head>
<body>
    <header>
        <h1>${(site.name)!}</h1>
    </header>
    <nav>
        <a href="${base}">Home</a>
<@_categoryList>
    <#list page.list as a>
        <a href="${a.url!}" target="_blank">${a.name}</a>
    </#list>
</@_categoryList>
    </nav>
    <main>
        <h3>Change password</h3>
        <form action="${site.dynamicPath}user/changePassword" method="post" class="text-center">
            <input type="hidden" name="_csrf" value="<@_csrfToken/>"/>
            <p><label>Old password</label><input type="password" name="oldpassword" placeholder="Old password" title="Old password" /></p>
            <p><label>New password</label><input type="password" name="password" placeholder="New password" title="New password" /></p>
            <p><label>Repeat Password</label><input type="password" name="repassword" placeholder="Repeat Password" title="Repeat Password" /></p>
            <p>
                <input type="submit" class="button" value="Submit"/>
            </p>
            <#macro message code>${springMacroRequestContext.getMessage(code)}</#macro>
            <#if error?has_content>
                <p class="message red"><@message error/></p>
            </#if>
            <#if message?has_content>
                <p class="message"><@message "message."+message/></p>
                <#if 'needReLogin'=message>
                    <form name="logout" action="${site.dynamicPath}doLogout" method="post">
                        <input type="hidden" name="userId" value="${(user.id)!}"/>
                        <input type="hidden" name="returnUrl" value="${returnUrl!site.sitePath!}"/>
                    </form>
                    <script>setTimeout("$('form[name]').submit();",1000);</script>
                </#if>
            </#if>
        </form>
    </main>
    <footer>
        Copyright &copy; ${.now?string('yyyy')}
    </footer>
    <script src="${site.dynamicPath!}resource/js/jquery-1.12.4.min.js"></script>
    <script>
    var itemString="itemType=user&itemId=${user.id}";
    </script>
    <script src="${site.dynamicPath}resource/js/cms.analytics.js"></script>
    <script>
        var ca = cmsAnalytics();
        var url='${site.dynamicPath}api/visit/record';
        if("string" ==typeof itemString){
            url=url+"?"+itemString;
        }
        ca.setDomain('${domain.name}');
        ca.setPath('/');
        ca.report(url);
    </script>
</body>
</html>